import { RouteRecordRaw } from 'vue-router'
import NavBar from '../components/navbar/index.vue'
import TabBar from '../components/tabbar/index.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/lead',
  },
  {
    path: '/home',
    components: {
      default: () => import('../views/home/index.vue'),
      footer: TabBar,
    },
    meta: {
      title: '首页',
      icon: 'home-o',
      inTabbar: true, // 要显示到 tabbar 上的标识
    },
  },
  {
    path: '/school',
    components: {
      default: () => import('../views/school/index.vue'),
      footer: TabBar,
    },
    meta: {
      title: '学院',
      icon: 'apps-o',
      inTabbar: true, // 要显示到 tabbar 上的标识
    },
  },
  {
    path: '/record',
    components: {
      default: () => import('../views/record/index.vue'),
      footer: TabBar,
    },
    meta: {
      title: '记录',
      icon: 'label-o',
      inTabbar: true,
    },
  },
  {
    path: '/mine',
    components: {
      default: () => import('../views/mine/index.vue'),
      footer: TabBar,
    },
    meta: {
      title: '我的',
      icon: 'user-circle-o',
      inTabbar: true,
    },
  },
  {
    path: '/login',
    components: {
      default: () => import('../views/login/index.vue'),
    },
  },
  {
    path: '/register',
    components: {
      default: () => import('../views/register/index.vue'),
    },
  },
  {
    path: '/lead',
    components: {
      default: () => import('../views/lead/index.vue'),
    },
  },
  {
    path: '/clock',
    components: {
      header: NavBar,
      default: () => import('../views/clock/index.vue'),
    },
    meta: {
      title: '日常打卡',
    },
  },
  {
    path: '/weight',
    components: {
      header: NavBar,
      default: () => import('../views/weight/index.vue'),
    },
    meta: {
      title: '体重记录',
    },
  },
  {
    path: '/date',
    components: {
      default: () => import('../views/mine/h/date.vue'),
    },
  },
  {
    path: '/kind',
    components: {
      default: () => import('../views/mine/h/kind.vue'),
      footer: TabBar,
    },
  },
]

export default routes
